public class NullListe { public static void main(String[] args) { String[] biester = new String[]{ null, "Löwe", null, "Nessos", null, null, "Medusa", "Minotaur", null, null }; String ausgabe = ""; int n; for (n = 0; n < biester.length; n++) { if (biester[n] != null) { // if ( ausgabe != "" ) { // if ( ! ausgabe.equals("") ) { if ( !ausgabe.isEmpty() ) { ausgabe += ", "; } ausgabe += biester[n]; } } System.out.println(ausgabe); } }